package org.example.controller;

import lombok.RequiredArgsConstructor;
import org.example.model.SyncConfigQuery;
import org.example.model.SyncConfigStats;
import org.example.service.SyncConfigStatisticsService;
import org.example.service.SyncService;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author by PengHongChao
 * @date 2025/6/26 15:15
 */
@RestController
@RequestMapping("/api/sync-statistics")
@RequiredArgsConstructor
@Validated
public class SyncConfigStatisticsController {
    private final SyncConfigStatisticsService statisticsService;
    /**
     * 统计配置状态
     */
    @GetMapping("/countConfigStatus")
    public ResponseEntity<?> countConfigStatus() {
        SyncConfigStats configStats = statisticsService.countConfigStatus();
        return configStats != null ?
                ResponseEntity.ok(configStats) :
                ResponseEntity.notFound().build();
    }
}
